<?php 
include 'ini.php';
include 'header.php';
?>

<script type="text/javascript">
    
window.onload=function()
{
resize();

}

window.onresize = function(event) {
    resize();
};

function resize()
{
    $("#english_test_passage_section").height($(window).height() - $('#navBarTop').height() - 100);
    $("#english_test_questions_section").height($(window).height() - $('#navBarTop').height() - 100);
}

</script>



<?php
if (isLoggedIn())
{
    
    function getEnglishAnswerLetter($questionNumber)
    {
        $result = array();
        if ($questionNumber % 2 == 1)
        {
            $result[] = "A";
            $result[] = "B";
            $result[] = "C";
            $result[] = "D";
        }
        else
        {
            $result[] = "F";
            $result[] = "G";
            $result[] = "H";
            $result[] = "J";
        }
        
        return $result;
    }
    $con = connectToDBPersistant();
    $result = $con->query("SELECT * FROM `acttestquestions` WHERE `testID` = 1 AND `sectionID` = 1");
    
    echo "<div class='english_test_passage_section' id='english_test_passage_section' data-spy='scroll' data-target='.navbar-example'>";
    
    echo "A lot of people hate to ride the New York City
subways, but I love them because I like to get places fast.
A musician balancing a cello case, two Buddhist monks 
in saffron robes, and a group of stockbrokers in crisp,
charcoal gray suits get on at Wall Street. A passenger
placidly sews while the subway train flings and jolts. A 
teenager whose holding a shoebox containing a kitten as 
tiny as a gingersnap smiles even if a line of girls in frilly 
white communion dresses file by. About three and a half 
million people a day ride the subways I think maybe I might possibly have met them all.

Sometimes a Salvation Army volunteer boards the
subway train with sandwiches and juice to give to the
needy. “Put your pride to the side!” the volunteer shouts,
and I’ve seen many people put out their hands. The
speaker also raises money. Its impossible to predict which 
people will dig into their pockets or if they were to open
their purses, and I’ve stopped trying to guess.
Last week some fellow passengers and I watched 
an elderly man with a portable chessboard playing
chess against himself. Just yesterday I sat across the 
aisle with a woman who was composing music 
in pink-tinted glasses in a notebook. She tapped her foot 
as she reviewed what she’d written and then stopped 
tapping and jotted more notes as the train hurtled along.
";
    
    echo "</div>";
    echo "<div class='english_test_questions_section' id='english_test_questions_section'>";
    
    while($row= $result->fetch_object())
    {
         echo "<div class='english_question_block' id='1_".$row->questionNumber."'><div class='test_question_number'>".$row->questionNumber.". </div><div class='english_question_text'>";
    
        if (strlen($row->questiontext) > 2)
        {
            echo $row->questiontext."<div class='clearFix'></div>";
            echo "<br>";
        }
        
        
        $letters = getEnglishAnswerLetter($row->questionNumber);
        
        echo "<table style='border: none;' cellspacing='0' cellpadding='0'><tbody>";
        echo "<tr><td>".$letters[0].".</td><td>".$row->answer1text."</td>";
        echo "<tr><td>".$letters[1].".</td><td>".$row->answer2text."</td>";
        echo "<tr><td>".$letters[2].".</td><td>".$row->answer3text."</td>";
        echo "<tr><td>".$letters[3].".</td><td>".$row->answer4text."</td>";
        echo "</tbody></table>";
        
        echo "</div></div><br><br>";
        
    }
    
    echo "</div>";
?>













<?php
}
else
{
?>



<?php } ?>

          
